This work describes and presents the properties of a proposed tuning system, which is compared with the well known pythagorean tuning system. These two methods are shown to be derived with a few algebraic rules. The two algorithms are compared in terms of their simplicity, correspondance to the consonance of intervals, and errors with the well-established twelve tone equal temperament tuning method. An important part of the proposed algorithm is a proposed inverse fraction rule, which closely corresponds to the method of obtaining the musical inverse in twelve-tone equal temperament.
In Western music, the most common tuning system since the 18th century has been twelve-tone equal temperament, which divides the octave into 12 parts, all of which are equal on a logarithmic scale. The frequency interval between every pair of adjacent notes has the same ratio equal to the 12th root of 2: $\sqrt[12]{2}$ ≈ 1.05946. Intervals are then described with $2^\frac{i}{12}$ where $i$ represents the number of semitones, also called halfsteps.
In music theory, the definition of the musical inverse of an interval is essentially to switch the order of the notes. An inverse-fraction rule is proposed for finding the musical inverse.
Consider the initial interval of a perfect fifth. The top note is G and the lower note is C. However, this applies for any interval.

Before switching, the upper note (G) has $\frac{3}{2}$ the frequency of the lower note (C). That means the frequency-ratio of the lower note (C) to the top note (G) is simply the mathematical inverse: $\frac{2}{3}$.
When the musical inverse is taken, the lower note is placed above the previous top note. Meaning, it is placed an octave higher than initially, and thus obtains twice the frequency. Therefore, in mathematical terms, the ratio of the frequencies changes as follows when the inverse is taken:
$$\large \frac{f_C}{f_G} = \frac{2}{3} \xrightarrow[\text{higher}]{\text{octave}} \frac{2\times2}{3} = \frac{4}{3}$$Where $f_C$ is the frequency of C and $f_G$ is the frequency of G.
In short, the inverse of an interval is found by multiplying the inverse of the frequency-ratio by two - a simple rule, which I have named the inverse fraction rule.
The proposed algorithm uses this method to obtain the musical inverse of notes. However, in twelve-tone equal temperament, the musical inverse is defined differently.
In the twelve-tone equal temperament, the inverse of an interval is taken as follows.
Let the upper note be $i$ semitones above the lower note. Then the initial frequency ratio is the following:
$$\large \frac{f_1}{f_2} = \large 2^\frac{i}{12}$$Then, the musical inverse is defined to be frequency ratio such that the previous bottom note is placed an octave higher.
Thus the previous lower note is now $12 - i$ semitones abouve the previous lower note. In the earlier case of the perfect fifth, G was $7$ semitones above C. After taking the inverse, C became %12 - 7 = 5$ semitones above G, which is a perfect fourth.
It will be shown that these two ways of taking the inverse are close approximations to one another with errors that can be calculated exactly.
Begin with the fraction $\large \frac{2}{1}$
For example: We start with $\large \frac{2}{1}$, a perfect octave. Following the 1st rule:
$$\frac{2}{1} \rightarrow \frac{2}{2} = \frac{1}{1}$$The result is a perfect unison (the inverse of a perfect octave). Then, following the 2nd rule:
$$\large \frac{2 + 1}{1 + 1} = \frac{3}{2}$$The result is a perfect fifth. Then, simply repeat the two steps again and again.
Begin with the calculation $\large (\frac{2}{3})^6 (2)^4$, which is $\large \frac{1024}{729}$
For example: We start with $\large (\frac{2}{3})^6 (2)^4 = \frac{1024}{729}$, a diminished fifth. Following the 1st rule: $\large (\frac{2}{3})^5 (2)^3 = \frac{256}{243}$, a minor second. Then, following the 2nd rule: $\large (\frac{2}{3})^4 (2)^3 = \frac{128}{81}$, a minor sixth. Etc.
Interestingly, the proposed algorithm naturally progresses from consonant intervals to dissonant intervals.
On the other hand, the pythagorean algorithm doesn't have such a clear progression in terms of the consonance/dissonance of intervals.
Some of the proposed fractions are reducible wheras all the Pythagorean fractions are irreducible.
Given two positive integers $a$ and $b$, and an integer $i$ from 0 through 12, inclusive. In the case of the tuning algorithm, $n = 12$ and $k = 2$.
If:
$$\large \frac{a}{b} \approx k^\frac{i}{n}$$Then:
$$\large \frac{kb}{a} \approx k^\frac{n - i}{n}$$Define $\epsilon$ as the initial error in terms of a ratio:
$$\large \epsilon = \frac{2^\frac{i}{12}}{\frac{a}{b}} - 1$$Define $\gamma$ as follows:
$$\large \gamma = \epsilon + 1$$Then we have:
$$\large \frac{a}{b} = \gamma k^\frac{i}{n}$$Rearranging algebraiclly we get:
As $\epsilon \rightarrow 0$, we have that $\gamma \rightarrow 1$. Therefore:
$$\large \frac{kb}{a} \rightarrow k^{\frac{n-i}{n}}$$In summary, if the initial interval has an error-ratio with twelve-tone equal temperament of $\gamma$, the resultant musical inverse (following the inverse fraction rule) will have an error-ratio of $\frac{1}{\gamma}$.
import tuning
tuning.plot_errors()
tuning.plot_abs_errors()
tuning.show_algorithm()